import request from '@/config/axios'

// 会员类型信息 VO
export interface MemberTypeVO {
  id: number // 主键
  name: string // 类型名称
  price: number // 价格
  termType: string //会员期限
  originalPrice: number // 价格
}

// 会员类型信息 API
export const MemberTypeApi = {
  // 查询会员类型信息分页
  getMemberTypePage: async (params: any) => {
    return await request.get({ url: `/wine/member-type/page`, params })
  },

  // 查询会员类型信息详情
  getMemberType: async (id: number) => {
    return await request.get({ url: `/wine/member-type/get?id=` + id })
  },

  // 新增会员类型信息
  createMemberType: async (data: MemberTypeVO) => {
    return await request.post({ url: `/wine/member-type/create`, data })
  },

  // 修改会员类型信息
  updateMemberType: async (data: MemberTypeVO) => {
    return await request.put({ url: `/wine/member-type/update`, data })
  },

  // 删除会员类型信息
  deleteMemberType: async (id: number) => {
    return await request.delete({ url: `/wine/member-type/delete?id=` + id })
  },

  // 导出会员类型信息 Excel
  exportMemberType: async (params) => {
    return await request.download({ url: `/wine/member-type/export-excel`, params })
  }
}
